/* Estilos generales y variables de color */
:root {
    --primary-color: #1a56db; /* Azul principal */
    --primary-dark: #1e429f; /* Azul oscuro para hover */
    --primary-light: #3f83f8; /* Azul claro para acentos */
    --secondary-color: #e0f2fe; /* Azul muy claro para fondos */
    --text-color: #1e293b; /* Color de texto principal */
    --text-light: #64748b; /* Color de texto secundario */
    --white: #ffffff;
    --gray-light: #f1f5f9;
    --gray: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--gray-light);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Estilos para el encabezado */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    background-color: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 600;
    margin-right: 15px;
}

.site-title {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.main-nav {
    margin-left: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover {
    background-color: var(--gray-light);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Estilos para el contenido principal */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
}

/* Estilos para la sección hero */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border-radius: 10px;
    padding: 60px 40px;
    margin-bottom: 40px;
    text-align: center;
}

.hero-content h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Estilos para la sección de plantillas */
.templates-section {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header h3 {
    font-size: 24px;
    color: var(--text-color);
}

.search-container {
    display: flex;
    max-width: 400px;
    width: 100%;
}

.search-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--gray);
    border-radius: 5px 0 0 5px;
    font-size: 14px;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.search-container button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 5px 5px 0;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-container button:hover {
    background-color: var(--primary-dark);
}

/* Estilos para los filtros de plantillas */
.templates-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--gray-light);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--gray);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Estilos para la cuadrícula de plantillas */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.template-card {
    background-color: var(--white);
    border: 1px solid var(--gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.template-icon {
    background-color: var(--secondary-color);
    padding: 20px;
    text-align: center;
}

.template-icon i {
    font-size: 40px;
    color: var(--primary-color);
}

.template-info {
    padding: 20px;
    flex: 1;
}

.template-info h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.template-info p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
}

.template-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.template-actions {
    display: flex;
    border-top: 1px solid var(--gray);
}

.template-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: var(--white);
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.template-actions button:first-child {
    border-right: 1px solid var(--gray);
}

.template-actions button:hover {
    background-color: var(--gray-light);
}

.btn-download {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
}

.btn-download:hover {
    background-color: var(--primary-dark) !important;
}

/* Estilos para la sección de información */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.info-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    gap: 20px;
}

.info-icon {
    font-size: 30px;
    color: var(--primary-color);
    display: flex;
    align-items: flex-start;
}

.info-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.info-content p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.info-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.info-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Estilos para el footer */
.footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 50px 30px 20px;
    margin-top: auto;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--white);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 1400px;
    margin: 30px auto 0;
}

/* Estilos para el modal de vista previa */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--text-color);
}

#modal-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.preview-container {
    margin-bottom: 20px;
    text-align: center;
}

#preview-image {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid var(--gray);
}

.modal-actions {
    text-align: center;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
    
    .main-nav {
        margin-left: 0;
        width: 100%;
    }
    
    .nav-list {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .templates-section,
    .info-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .template-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .info-card {
        flex-direction: column;
    }
}